#include <stdio.h>

#define MAX_M 100

int mod(int a, int m)
{
    int r = a % m;
    return (r < 0)? r + m : r;
}

int modadd(int a, int b, int m)
{
    int r = a + b;
    return (r < m)? r : r - m;
}

int solve_case()
{
    int N;      /* number of input numbers */
    int M;      /* modulus */
    int first;  /* first input number, or its residue mod M */
    int i, r;

    /* count[r] = number of input integers equivalent to r or M-r (mod M). */
    int count[MAX_M/2+1] = { 0 };   

    /* flags[r] = the earliest round where residue r was added. */
    int flags[MAX_M] = { 0 };

    /* next[r] = next achievable residue, or -1 if this is the tail */
    int next[MAX_M];
    
    if (scanf("%d %d %d", &N, &M, &first) != 3)
        return 0;

    /* Read residuals and update the counters. */
    for (i = 1; i < N; i++)
    {
        scanf("%d", &r);
        r = mod(r, M);
        if (r > M/2)
            r = M - r; /* e.g. 3 (mod 5) and 2 (mod 5) can be combined */
        count[r]++;
    }

    /* For each residue class r >= 1, there are n = count[r] instances. 
     * The achievable sums of these instances are -nr .. +nr step 2r,
     * or equivalently -nr + (2r)*i for i = 0 to n.
     * The total sum is therefore:
     * first - n1*1 - ... - n[M-1]*(M-1) + (2*1)*i1 + ... + 2*(M-1)*i[M-1].
     * We split this into two parts, and solve for the sum to be zero.
     */
    for (r = 1; r <= M/2; r++)
    {
        first -= count[r] * r;
    }
    first = mod(first, M);
    flags[first] = 1;
    next[first] = -1;

    for (r = 1; r <= (M-1)/2; r++) /* skip M/2 if M is even */
    {
        /* For each of the currently achievable residue value k, try all 
         * combinations of this residual r to add to k. */
        int k;
        if (count[r] == 0)
            continue;

        for (k = first; k >= 0; k = next[k])
        {
            if (flags[k] <= r) /* added before this round */
            {
                int kk = k;
                for (i = 0; i < count[r]; i++)
                {
                    if ((kk = modadd(kk, 2*r, M)) == k) /* cycle */
                        break;
                    if (flags[kk] == 0)
                    {
                        next[kk] = next[k];
                        next[k] = kk;
                        flags[kk] = r + 1;
                    }
                }
            }
        }

        if (flags[0]) /* shortcut if already divisible */
            break;
    }

    printf("%s\n", flags[0]? "Divisible" : "Not divisible");
    return 1;
}

int main()
{
    while (solve_case());
    return 0;
}
